import request from '@/utils/request'




export function savePaper(paperData) {
    return request({
        url: '/papers/save',
        method: 'post',
        data: paperData
    })
}


export function deletePdfPage(filePath, pageNumber) {
    return request({
        url: '/deletePdfPage',
        method: 'post',
        params: { filePath, pageNumber }
    })
}

export const paperApi = {
    getPapers(params) {
        return request.post('/papers/getPapers', params);
    },
    deletePaper(id) {
        return request.delete(`/papers/deleteById/${id}`);
    }
};

/**
 * 根据id来查询论文信息
 */
export function getPaperById(id) {
    return request.get(`/papers/getPapersById/${id}`);
}


/**
 * 更新论文信息
 */
export function updatePaper(paperData) {
    return request.put('/papers/update', paperData);
}



/**
 * 根据多个id批量查询论文信息
 */
export function getPapersByIds(ids) {
    return request.post(`/papers/getPapersByIds`, ids);
}

/**
 * excel批量导出
 */
export function exportPaper(params) {
    return request.post(`/papers/export/papers`, params, {
        responseType: 'blob'
    });
}
